package com.itheima.exception;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Demo03 {

    public static void main(String[] args) {

        try {
            System.out.println("A");
            int[] arr = {};
            System.out.println(arr[1]);//索引越界异常
            System.out.println("B");
           // String s= (String) new Object();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
            Date date = sdf.parse("2021年10月13月");
            System.out.println(date);
        } catch (NullPointerException e) {
            System.out.println("C");
        } catch (ArrayIndexOutOfBoundsException e) {
            System.out.println("E");
        }catch (RuntimeException e){
            System.out.println("F");
        }catch (Exception e){
            System.out.println("G");
        }

        System.out.println("D");


        while (true) {

        }
    }
}
